﻿using Sissonix.Infrastructure.RepositoryFramework;
using System.Data.Objects.DataClasses;
using System.Collections.Generic;
using Sissonix.Infrastructure.DomainBase;

namespace Sissonix.Infrastructure
{
    public interface IUnitOfWork
    {
        void RegisterAdded(IAggregateRoot entity, IUnitOfWorkRepository repository);
        void RegisterChanged(IAggregateRoot entity, IUnitOfWorkRepository repository);
        void RegisterRemoved(IAggregateRoot entity, IUnitOfWorkRepository repository);
        Dictionary<IAggregateRoot, IUnitOfWorkRepository> Adds { get; }
        Dictionary<IAggregateRoot, IUnitOfWorkRepository> Changes { get; }
        Dictionary<IAggregateRoot, IUnitOfWorkRepository> Deletes { get; }
        bool HasRecords {get;}
        void Commit();
        object Key {get;}
    }
}
